import axios from 'axios'

export function get(url, params) {

    return new Promise((resolve, reject) => {
        axios.get(url, {
            params: params
        }).then(res => { resolve(res.data) }).
            catch(err => {
                reject(err)
            })
    })
}
//post方法封装
export function post(url, params,config) {
    return new Promise((resolve, reject) => {
        axios.post(url, params,config).then(res => { resolve(res.data) }).catch(err => {
            reject(err)
        })
    })
}
